#ifndef COMPROWIDGET_H
#define COMPROWIDGET_H

#include <Fl/Fl_Group.h>
#include <Fl/Fl_Value_Output.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Output.H>
#include <FL/Fl_Int_Input.H>
#include <FL/Fl_Value_Input.H>
#include <FL/Fl_Light_Button.H>
#include "form.h"
#include "component.h"
#include <tinyxml.h>

class component;
class comProWidget : public Fl_Group
{
    public:
        comProWidget(int x,int y,int px,int py,int pid, std::string tip,component *comp);
        virtual ~comProWidget();
        void pozisyon(int px,int py);

        void _wStatus_(int p);
        void _wSelectable_(bool p);
        void _wDeletable_(bool p);
        void _wMovable_(bool p);
        void _wFromLink1_(bool p);
        void _wFromLink2_(bool p);
        void _wToLink1_(bool p);
        void _wToLink2_(bool p);
        void _wAngel_(int p);

        static void wStatus_CB(Fl_Widget *w,void *userdata);
        void wStatus_CB2();

        static void wAngel_CB(Fl_Widget *w,void *userdata);
        void wAngel_CB2();

        static void wSelectable_CB(Fl_Widget *w,void *userdata);
        void wSelectable_CB2();

        static void wDeletable_CB(Fl_Widget *w,void *userdata);
        void wDeletable_CB2();

        static void wMovable_CB(Fl_Widget *w,void *userdata);
        void wMovable_CB2();

        static void wFromLink1_CB(Fl_Widget *w,void *userdata);
        void wFromLink1_CB2();

        static void wFromLink2_CB(Fl_Widget *w,void *userdata);
        void wFromLink2_CB2();

        static void wToLink1_CB(Fl_Widget *w,void *userdata);
        void wToLink1_CB2();

        static void wToLink2_CB(Fl_Widget *w,void *userdata);
        void wToLink2_CB2();

        static void wValue_CB(Fl_Widget *w,void *userdata);
        void wValue_CB2();

        void itemDegerAta();

        Fl_Value_Output * xx();
        Fl_Value_Output * yy();
        Fl_Value_Output * Id();
        Fl_Output * Tip();
        Fl_Output * Value();
        Fl_Choice* Angel();
        Fl_Choice * Status();
        Fl_Light_Button * Selectable();
        Fl_Light_Button * Deletable();
        Fl_Light_Button * Movable();
        Fl_Light_Button * FromLink1();
        Fl_Light_Button * FromLink2();
        Fl_Light_Button * ToLink1();
        Fl_Light_Button * ToLink2();
        Fl_Choice * Item();
    protected:
    private:
        TiXmlDocument *doc;
        Fl_Box *etiket[15];
        Fl_Output *wTip;
        Fl_Choice *wItem;
        Fl_Value_Output *wx;
        Fl_Value_Output *wid;
        Fl_Value_Output *wy;
        Fl_Output *wValue;
        Fl_Choice *wAngel;
        Fl_Choice *wStatus;
        Fl_Light_Button *wSelectable;
        Fl_Light_Button *wDeletable;
        Fl_Light_Button *wMovable;
        Fl_Light_Button *wFromLink1;
        Fl_Light_Button *wFromLink2;
        Fl_Light_Button *wToLink1;
        Fl_Light_Button *wToLink2;
        component *sahip_;
        bool alver[2];
        TiXmlElement *element;
        std::string path;
};

#endif // COMPROWIDGET_H
